<template>
  <div class="line-list">
    <div>
      <Button type="primary" @click="addLine()">新增配置</Button>
    </div>
    <div>
      <Table class="list-content" border :columns="columns7" :data="lineData">
        <template slot-scope="{ row }" slot="action">
          <div class="table-form-action-box">
            <Button type="primary" size="small" @click="toDetail(row)">编辑</Button>
          </div>
        </template>
      </Table>
    </div>
  </div>
</template>

<script>
import { getList } from 'http/api/linemanage';

export default {
  name: 'LineList',
  data () {
    return {
      columns7: [
        {
          title: '序号',
          type: 'index',
          width: 60,
          align: 'center'
        },
        {
          title: 'modeName',
          key: 'modeName',
          width: 300
        },
        {
          title: 'modelId',
          key: 'modelId'
        },
        {
          title: '描述',
          key: 'describe'
        },
        {
          title: '操作',
          key: 'action',
          width: 150,
          align: 'center',
          slot: 'action'
        }
      ],
      lineData: []
    };
  },

  methods: {
    // 业务线详情
    toDetail (row) {
      this.$router.push({ path: '/home/linemanage/medaldetail?modelId=' + row.modelId });
    },
    // 新建业务线
    addLine () {
      this.$router.push({ path: '/home/linemanage/medaldetail' });
    },
    getBusList () {
      getList('medal').then(res => { // 勋章列表和标注方式列表标识
        if (res) {
          this.lineData = res.data;
        }
      })
        .catch(err => {
          this.$Message.error(err);
        })
    }
  },
  mounted () {
    this.getBusList()
  }
};
</script>

<style rel="stylesheet/less" lang="less" scoped>
.line-list {
  padding: 20px;
  .list-content{
      margin:20px 0;
  }
}
</style>

<style lang="less">
</style>
